Differential Equations and Numerical Calculus
Bren Calculus Workshop
Nathaniel Grimes
Bren School of Environmental Science & Management
Last updated: Sep 24, 2024
\[ \begin{align} \text{A) }y=\frac{3}{x^2}, y(0)=5& &\text{B) }g(t)=3t^5-2t^3+16t-7 & &\text{C) } \int^4_2\frac{1}{2}x \end{align} \]
Exponent rules in Integration
\[ \large \int e^xdx=e^x+C \]
If the x term gets more complex, we need integration by parts or substitution. Very Complicated and We will not cover!
Numerical Calculus will handle this for us
Natural Logs in Integration
\[ \large \int \frac{1}{x}=\ln x+C \]
\[ \begin{align} \int \ln x&=x\ln x-x+C \end{align} \]
No easy chain rule equivalent in Integration
This is solved by integration by parts
Differential Equations help us study how things interact together over time
X and Y are not independent, they change with each other
\[ \large \frac{dy}{dx}=4y+2x \]
Differential Equations help us understand changing environments
Predator-Prey Dyanmics are classic ecological cases of differential equations
Differential Equations are systems in motion
Groundwater velocity
We can use phase diagrams to understand the system
Find isoclines (where \(dy/dx=0\))
Determine the direction of the flow
Find the equilibrium points
Determine the stability of the equilibrium points
Steps to Solving ODEs
Move like terms to the same side, including differentials (dx,dy)
Apply the integral to both sides
Rearrange equations to isolate in terms of dependent variable
Use initial conditions (if given) to find C values
Evaluate the bounds if definite intervals are given
Practice Differential Equations
\[ \frac{dy}{dx}=4y \]
\[ \frac{dy}{4y}=dx \]
\[ \begin{align} \int\frac{dy}{4y}&=\int dx\\ \frac{1}{4}\ln y&=x+C_1 \\ \ln y&=4x+C_2\\ y&=e^{4x+C_2} \\ y&=e^{C_2}e^{4x} \\ y&=Ce^{4x} \end{align} \]
An oil spill of the coast of Santa Barbara is spreading rapidly. Previous spills and an analysis of the current indicate that the oil is spreading at a daily rate of:
\[ \frac{dA}{dt}=-0.001A+60 \]
Where A is the area of the oil spill in \(km^2\) and t is the time in days.
If after the first day the oil has spread to 25 \(km^2\), find an equation to show the spread of oil in total area.
When will the oil spill cover all of the Santa Barbara Channel (~5850 \(km^2\))?
Hint:(The integral of \(\frac{1}{ax+b}=\frac{ln(ax+b)}{a}\) Think reverse chain rule)
Functions in R
All functions have documentation
We can make our own functions
Key pieces of R functions
Steps - All the instructions we apply within our function contained within \(\{\}\)
return())Can you arrange this function into the correct order?
Solution